<!--
*Author：COCO
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/production/production/Production_Inventory.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/production/production/Production_Inventory.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'InvId',
                footer: "Foots",
                cnName: '期初库存',
                name: 'production/Production_Inventory',
                url: "/Production_Inventory/",
                sortName: "FMonth"
            });
            const editFormFields = ref({});
            const editFormOptions = ref([]);
            const searchFormFields = ref({"OrgCode":"","FMonth":"","FNumber":""});
            const searchFormOptions = ref([[{"dataKey":"Org","data":[],"title":"组织","field":"OrgCode","type":"select"},{"title":"年月","field":"FMonth","type":"month"}],[{"title":"物料编号","field":"FNumber","type":"like"}]]);
            const columns = ref([{field:'InvId',title:'ID',type:'long',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'OrgCode',title:'组织',type:'string',bind:{ key:'Org',data:[]},width:110,align:'left',sort:true},
                       {field:'FMonth',title:'年月',type:'string ',width:110,require:true,align:'left'},
                       {field:'FItemID',title:'物料ID',type:'long',width:110,hidden:true,align:'left'},
                       {field:'FNumber',title:'物料编号',type:'string',width:220,align:'left'},
                       {field:'FQty',title:'数量',type:'decimal',width:110,align:'left'},
                       {field:'CreateDate',title:'创建时间',type:'datetime',width:110,align:'left',sort:true},
                       {field:'Creator',title:'创建人',type:'string',width:130,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
